function factory(){
    this.type="";
    this.config="";
    

}

factory.prototype={
    type:"",
    /**
     * 获取表单类型
     */
    getType:function(){
        var typeList=$a('#type>input');
        /**
         * 给表达类型框设置单选
         */
        listLimit(typeList);
        //获取type类型
        for(var i=0;i<typeList.length;i++){
            if(typeList[i].checked){
                this.type=typeList[i].name
            }
        }

    },
    config:{
        name:"",
        necessary:""
    },

    getConfig:function(){
        this.config.name=$('#formName').value;
        this.config.necessary=$("#formNecessary").checked;
    },
    rule:"",
    getRule:function(){
        if(this.type!='input'){
            this.rule=null;
        }else{
            var ruleList=$a('#rule>input');
            listLimit(ruleList)
        }

    },
    lengthLimit:{
        maxLength:'',
        minLength:'',
    },
    setLength:function(){
        if(!(this.type=='input'||this.type=='textArea')){
            return;
        }
        this.lengthLimit.maxLength=$('#maxLength').value;
        this.lengthLimit.minLength=$('#minLength').value;
    },
    DOM:{
        RuleArea:$('#rule'),
        LengthArea:$('#length')
    },
    create:function(){
        var form=createForm(this.type,this.config,this.rule,this.lengthLimit)
    }

}


var fac=new factory();

$('#create').onclick=function(){
    fac.getType();
    fac.getRule();
    console.log(fac.type)

}
